package gwtI18nEditor.tools;

import java.util.Iterator;

public abstract class IteratorWrapper<InType, OutType> implements Iterator<OutType> {
	
	private final Iterator<InType> iterator;
	
	public IteratorWrapper(Iterator<InType> iterator) {
		this.iterator = iterator;
	}

	@Override
	public boolean hasNext() {
		return iterator.hasNext();
	}

	@Override
	public OutType next() {
		InType next = iterator.next();
		if (next==null) return null;
		return wrap(next);
	}

	@Override
	public void remove() {
		iterator.remove();
	}

	public abstract OutType wrap(InType value);
}
